package com.yunzhou.service.impl;

import com.yunzhou.entity.ForumArticleAttachment;
import com.yunzhou.mapper.ForumArticleAttachmentMapper;
import com.yunzhou.service.ForumArticleAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ForumArticleAttachmentServiceImpl implements ForumArticleAttachmentService {

    @Autowired
    ForumArticleAttachmentMapper forumArticleAttachmentMapper;

    // 根据文章ID获取文章附件
    @Override
    public List<ForumArticleAttachment> getForumArticleAttachmentListByArticleId(Long articleId) {
        return forumArticleAttachmentMapper.getForumArticleAttachmentListByArticleId(articleId);
    }

    // 新增文章附件
    @Override
    public void insert(ForumArticleAttachment forumArticleAttachment) {
        forumArticleAttachmentMapper.insert(forumArticleAttachment);
    }

    // 更新文章附件
    @Override
    public int update(ForumArticleAttachment forumArticleAttachment) {
        return forumArticleAttachmentMapper.update(forumArticleAttachment);
    }

}
